﻿using mozhi.smarterp.Finance.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace mozhi.smarterp.Finance.Treasuries.Payments.Requisition
{
    public class PaymentRequisitionCreateDto
    {
        [Required]
        public DateTime Date { get; set; }

        [Required]
        public PaymentRequisitionType Type { set; get; }

        [Required]
        public TradingPartnerType TradingPartnerType { set; get; }

        public Guid? SupplierId { set; get; }

        public Guid? EmployeeId { set; get; }

        public Guid? CustomerId { set; get; }

        [Required]
        public Guid CurrencyId { set; get; }

        [Required]
        public decimal ExchangeRate { set; get; }

        /// <summary>
        /// 是否预付款
        /// </summary>
        public bool IsAdvanced { set; get; }

        public string Comment {  set; get; }

        public List<PaymentRequisitionItemCreateDto> Items { set; get; }
    }

    public class PaymentRequisitionItemCreateDto
    {
        public DocumentType? SourceDocumentType { set; get; }

        public Guid? SourceDocumentId { set; get; }

        public Guid? SourceDocumentEntryId { set; get; }

        public decimal? PayableAmountFr { get; set; }

        public decimal? PayableAmount { get; set; }

        [Required]
        public decimal RequisitionAmountFr { set; get; }

        public DateTime? DueDate { get; set; }

        public DateTime? ExpectedPaymentDate { get; set; }

        public string Remark { protected set; get; }

        public int Index { protected set; get; }
    }
}
